package com.yun.fullstack.controller;

import com.yun.fullstack.common.Result;
import com.yun.fullstack.service.OSSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/oss")
@Api(value = "OSS控制器", tags = {"OSS"})
public class OSSController {
    @Autowired
    private OSSService ossService;

    @ApiOperation(value = "上传文件", notes = "上传文件")
    @PostMapping("/upload")
    public Result<?> upload(@RequestPart("file") MultipartFile file){
        return ossService.uploadFile(file);
    }

}
